package com.skt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.skt.domain.PO.RentalOrderItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Collection;
import java.util.List;

/**
 * 租赁订单明细 Mapper
 * 对应数据库表：rental_order_item
 */
@Mapper
public interface RentalOrderItemMapper extends BaseMapper<RentalOrderItem> {

    /**
     * 根据订单ID查询所有订单商品项
     */
    @Select("SELECT * FROM rental_order_item WHERE order_id = #{orderId}")
    List<RentalOrderItem> selectByOrderId(Long orderId);


    /**
     * 根据多个订单 ID 查询所有关联的订单项
     *
     * @param orderIds 订单ID集合（非空）
     * @return 订单项列表
     */
    List<RentalOrderItem> selectByOrderIds(@Param("orderIds") Collection<Long> orderIds);
}